package com.rcl.himalaya_kotlin.utils

import android.util.Log

/*
 * class title: 
 * Author by RenChunLin, Email 18957806320@163.com, Date on 2020/9/2.
 * PS: Not easy to write code, please indicate.
 */
object LogUtil {
    var sTAG = "LogUtil"

    //控制是否要输出log
    var sIsRelease = false

    /**
     * 如果是要发布了，可以在application里面把这里release一下，这样子就没有log输出了
     */
    fun init(baseTag: String, isRelease: Boolean) {
        sTAG = baseTag
        sIsRelease = isRelease
    }

    fun d(TAG: String, content: String?) {
        if (!sIsRelease) {
            Log.d("[$sTAG]$TAG", content)
        }
    }

    fun v(TAG: String, content: String?) {
        if (!sIsRelease) {
            Log.d("[$sTAG]$TAG", content)
        }
    }

    fun i(TAG: String, content: String?) {
        if (!sIsRelease) {
            Log.d("[$sTAG]$TAG", content)
        }
    }

    fun w(TAG: String, content: String?) {
        if (!sIsRelease) {
            Log.d("[$sTAG]$TAG", content)
        }
    }

    fun e(TAG: String, content: String?) {
        if (!sIsRelease) {
            Log.d("[$sTAG]$TAG", content)
        }
    }
}